#import "DatePicker.h"


@implementation DatePicker
@synthesize datePicker;

- (IBAction) pressButton
{   
    // Get the date
    NSDate *choice = [datePicker date];
    // Convert to string
    NSString *words = [[NSString alloc] initWithFormat:@"%@", choice];
    
    // Make an alert box with the date
    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"The title"
                message:words
                delegate:nil
                cancelButtonTitle:@"close"
                otherButtonTitles:nil];
    
    // Show the alert box
    [alert show];
    
    // Free memory
    [alert release];
    [words release];
}

- (void)didReceiveMemoryWarning 
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc. that aren't in use.
}

- (void)viewDidUnload 
{
    self.datePicker = nil;
    [super viewDidUnload];

}


- (void)dealloc 
{
    [datePicker release];
    [super dealloc];
}


@end
